﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

namespace LightningForms
{
    public class Zip : BaseTextControl
    {
        private string script()
        {
            return "_lf.AddControl({ Control: '#_R_', Type: _lf.Type.ZIP });"
                .Replace("_R_", this.ClientID);
        }

        public Zip()
        {
            this.DataType = ValidationDataType.String;
        }

        protected override void OnPreRender(EventArgs e)
        {
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, script(), true);
            base.OnPreRender(e);
        }
    }
}